package com.gf.framework.web.annotation;

import com.gf.framework.web.translate.Translatable;

import java.lang.annotation.*;

/**
 * @author gaofei
 */
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Target(ElementType.FIELD)
public @interface Translate {

    /**
    * @author: gaofei
    * @date: 2022/5/26
    * @description: 自定义的属性翻译器
    */
    Class<? extends Translatable> translator() default Translatable.class;

    /**
    * @author: gaofei
    * @date: 2022/5/26
    * @description: 暂时没啥用过
    */
    Class<?> dataSource() default Void.class;

    /**
    * @author: gaofei
    * @date: 2022/5/26
    * @description: 翻译的属性来自哪个字段
    */
    String from();

    /**
    * @author: gaofei
    * @date: 2022/5/26
    * @description: 来源字段是否可以为null，默认不能为null
    */
    boolean notnull() default true;

    /**
    * @author: gaofei
    * @date: 2022/5/26
    * @description: 额外的翻译参数
    */
    String param() default "";

}
